package com.jt.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jt.mapper.UserMapper;
import com.jt.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserMapper userMapper;
    public List findAll(){
        return userMapper.selectList(null);
    }

    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }

    @Override
    public void update(User user, QueryWrapper qw) {
        userMapper.update(user,qw );
    }

    @Override
    public void delete(Integer id) {
        QueryWrapper qw=new QueryWrapper();
        System.err.println("id"+id);
        qw.eq("id", id);
        System.err.println(userMapper.delete(qw));;
    }
}
